<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作业</title>
    <style>
        table{border: 10px solid burlywood ;padding:20px;}
        tr{border: 1px solid rgb(132, 0, 255) }
        .tr1{background-color: blue}
        .tr2{background-color: gold}
    </style>

</head>
<body>
        {# 导入过滤器文件 #}
        {% load my_filter %}
    <table>
        <tr>
            <td>姓名</td>
            <td>成绩</td>
            <td>性别</td>
        </tr>
        {% for item in test_list %}
        {% if forloop.counter == 1 %}
        <tr class="tr1">
        {% elif forloop.counter == 3 %}
        <tr class="tr2">
        {% endif %}
            <td>{{ item.name | gender:item.gender }}</td>
            <td>{{ item.score | score }}</td>
            <td>{{ item.gender }}</td>
        </tr>
        {% endfor %}
    </table>
    
</body>
</html>